define([''],function () {
    return {
        path: '/tming',
        name: 'tming',
        params: {},//对象，包含路由中的动态片段和全匹配片段的键值对
        query: {},//对象，包含路由中查询参数的键值对。
        matched: {},//数组，包含当前匹配的路径中所包含的所有片段所对应的配置参数对象。
        //redirect:'/b',//重定向
        component: function (resolve) {
            const Foo = {
                template:get('vue/tming.vue').responseText,
                data: function () {
                    return {
                        name: 'tming',
                        a: 444,
                        list:{}
                    }
                },
                methods: {
                    dianwo: function () {
                        console.log('点我干啥...');
                    },
                    fetchData:function () {
                        this.name = 777;
                    },
                    getData:function () {
                        this.$http.post('http://api.he29.com/api/twitter/find',{
                            page:1
                        }).then(function (res) {
                            this.list = res.data.list;
                        });
                    }
                },
                created:function () {
                    console.log('tming');
                    this.fetchData();
                    this.a = 555;
                    this.getData();//测试接口调用
                },
                beforeRouteEnter:function (to, from, next) {
                    console.log(to);
                    next();
                },
                computed: {}
            };
            resolve(Foo);
        },
        //子路由
        subRoutes: {
            '/news': {},
            '/message': {}
        }
    }
});
